package com.wsjj.yjh;

import org.apache.doris.flink.cfg.DorisStreamOptions;
import org.apache.doris.flink.datastream.DorisSourceFunction;
import org.apache.doris.flink.deserialization.SimpleListDeserializationSchema;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.List;
import java.util.Properties;


public class DataStreamSourceDemo {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);

        Properties properties = new Properties();
        properties.put("fenodes","192.168.10.105:8030");
        properties.put("username","root");
        properties.put("table.identifier","test_doris.student_kafka");
        properties.put("password","000000");


        DataStreamSource<List<?>> addSource = env.addSource(new DorisSourceFunction(new DorisStreamOptions(properties), new SimpleListDeserializationSchema()));

        addSource.print();


        env.execute();


    }
}
